﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TSP
{
    class Edge
    {
        double weight;

        public double Weight
        {
            get { return weight; }
            set { weight = value; }
        }
        Vertex from;

        internal Vertex From
        {
            get { return from; }
            set { from = value; }
        }
        Vertex to;

        internal Vertex To
        {
            get { return to; }
            set { to = value; }
        }
        bool hasBeenUsedByEuler = false;
        internal bool HasBeenUsedByEuler
        {
            get { return hasBeenUsedByEuler; }
            set { hasBeenUsedByEuler = value; }
        }

        public Edge(Vertex _from, Vertex _to, double w)
        {
            from = _from;
            to = _to;
            weight = w;
        }

        public string print()
        {
            String output = "Egde: ";
            output += this.From.Position.ToString() + " -> " + this.to.Position.ToString() + "; w: " + this.weight.ToString("f4") + "\n";
            return output;
        }

    }
}
